/* eslint-disable indent,space-before-function-paren,standard/no-callback-literal */
import {uploadPic} from '../api/api'

export function Upload(file, type, callback) {
    var formData = new FormData()
    formData.append('file', file)
    formData.append('pathName', type)
    uploadPic(formData).then(
        data => {
            callback(`/upload/${data.path}`)
        }
    ).catch(
        msg => {
            console.log('错误')
        }
    )
}
